<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWxUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_user', function (Blueprint $table) {
            $table->id();
            $table->integer("uid")->comment("uid");
            $table->string("wxname")->comment("公众号名");
            $table->string("aeskey")->comment("aeskey")->default("");
            $table->boolean("encode")->default(false)->comment("encode");
            $table->string("appid")->comment("appid")->default("");
            $table->string("appsecret")->comment("appsecret")->default("");
            $table->string("wxid")->comment("公众号原始id");
            $table->string("weixin")->comment("微信号");
            $table->string("headerpic")->comment("头像地址");
            $table->string("token")->comment("token");
            $table->string("w_token")->comment("微信对接token")->default("");
            $table->string("tplcontentid")->comment("内容模版ID");
            $table->string("share_ticket")->comment("分享ticket");
            $table->string("share_dated")->comment("share_dated");
            $table->string("authorizer_access_token")->comment("authorizer_access_token");
            $table->string("authorizer_refresh_token")->comment("authorizer_refresh_token");
            $table->string("authorizer_expires")->comment("authorizer_expires");
            $table->boolean("type")->default(false)->comment("类型");
            $table->string("web_access_token")->comment(" 网页授权token");
            $table->string("web_refresh_token")->comment("web_refresh_token");
            $table->integer("web_expires")->comment("过期时间");
            $table->text("menu_config")->comment("菜单")->nullable();
            $table->boolean("wait_access")->comment("是否接入")->default(false)->nullable();
        });
        DB::statement("ALTER TABLE `wx_user` comment'微信公众号信息寄存表，TP用'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wx_user');
    }
}
